package com.xs.common.excel;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author xs
 * date 2018/3/26 22:37
 */
public class User {

    @ExcelField(name = "id", isUnique = true,column = "A")
    @NotNull(message = "id不能为空")
    private Long id;

    @ExcelField(name = "姓名",isUnique = true,column = "B")
    @NotEmpty(message = "姓名不能为空")
    private String name;

    @Max(value=20)
    @ExcelField(name = "年龄", column = "C")
    @NotNull(message = "年龄不能为空")
    private Integer age;

    @ExcelField(name = "生日", column = "D")
    private Date birthday;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", birthday=" + birthday +
                '}';
    }
}